"""@main 装饰器扩展

处理主函数装饰器。
"""

from ..ir import IRContext
from ..extension_base import extension_processor


@extension_processor(
    "main",
    match_rule=[{"decorator": "main", "node_type": "function"}],
)
def process_main(context: IRContext):
    """处理@main装饰器"""

    node = context.node
    node.name = "main"
    node.set_extension_param("is_main_function", True)
